﻿using Game1942.Library.Background;

namespace Game1942.Library
{
    public abstract class LivingElement : Element
    {
        public bool Alive { get; set; }
        protected bool playerTeam;
        protected int damage;

        protected LivingElement()
        {
            Alive = true;
        }
        
        //public abstract void Move();
        // Different for Algo42
        public override int HarmSomebody(int enemyEnergy)
        {
            return enemyEnergy - damage;    // HarmSomebody by default
        }
        public abstract void Destroy();

        public override bool IsEnemy(Element intruder)
        {
            return intruder.IsEnemy(playerTeam);
        }

        public override bool IsEnemy(bool playerteam)
        {
            return playerTeam != playerteam;
        }

        public virtual void SetPosition(Point aPosition)
        {
            position.Value = aPosition;
        }
    }
}
